package com.github.postsanf.yinian.service;


import android.content.Intent;
import android.util.Log;

import com.github.postsanf.yinian.BaseIntentService;
import com.github.postsanf.yinian.constants.CommonConstants;
import com.github.postsanf.yinian.utils.SpUtils;
import com.litesuits.http.exception.HttpException;
import com.litesuits.http.listener.HttpListener;
import com.litesuits.http.request.StringRequest;
import com.litesuits.http.request.param.HttpMethods;
import com.litesuits.http.response.Response;

import java.util.LinkedHashMap;

public class ModifyTypeService extends BaseIntentService {

    public ModifyTypeService() {
        super("ModifyTypeService");
    }

    @Override
    protected void onHandleIntent(Intent intent) {
        modifyType();
    }


    //继续上传上次上传失败的数据
    private void modifyType() {
        final LinkedHashMap<String, String> mParam = new LinkedHashMap<>();
        mParam.put(CommonConstants.YNS_GROUP_ID, String.valueOf(application.getCurGid()));
        StringRequest req = new StringRequest("https://api.zhuiyinanian.com/YinianProject/yinian/ModifySpaceType")
                .setMethod(HttpMethods.Post)
                .setParamMap(mParam)
                .setHttpListener(new HttpListener<String>() {
                    @Override
                    public void onSuccess(String s, Response<String> response) {
                        Log.d("yuhao", "modifyType");
                    }
                    @Override
                    public void onFailure(HttpException e, Response<String> response) {

                    }
                });
        liteHttp.executeAsync(req);
    }
}
